<h2>Add New Project</h2>
<?=form_open('user/tasks/create_project')?>
<table class="table-condensed" width="100%">
  <tr>
    <td>Project Name</td>
    <td><input type="text" name="name" value="<?=set_value('name')?>" /></td>
    <td class="text-error"><?= form_error('name')?></td>
  </tr>
  <tr>
    <td>Description</td>
    <td><textarea name="desc"><?=set_value('desc')?></textarea></td>
    <td class="text-error"><?= form_error('desc')?></td>
  </tr>
  <tr>
    <td>Start date</td>
    <td><input type="text" name="start_date" id="dpd1"  value="<?=set_value('start_date')?>"/></td>
    <td class="text-error"><?= form_error('start_date')?></td>
  </tr>
    <tr>
      <td>Due date</td>
      <td><input type="text" name="due_date" id="dpd2" value="<?=set_value('due_date')?>" /></td>
      <td class="text-error"><?= form_error('due_date')?></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="Create Projects" class="btn" /></td>
    <td></td>
  </tr>
</table>
</form>
<hr />
<h3>Project Details</h3>
<table width="100%" id="example" class="table table-condensed">
<thead>
  <tr>
    <th>Name</th>
    <th>Description</th>
    <th>Start Date</th>
    <th>Due date</th>
    <th>Created on</th>
    <th>Created by</th>
    <th>Status</th>
    <th>Action</th>
  </tr>
  </thead>
  <?php foreach($projects as $project) {?>
  <tr>
    <td><?= $project->name?></td>
    <td><?= $project->desc?></td>
    <td><?= $project->start_date?></td>
    <td><?= $project->end_date?></td>
        <td><?= $project->created_on?></td>
            <td><?= $project->username?></td>
    <td><?php 
	if($project->is_completed == 0)
	{
	echo "Incompleted";	
	}
	else{ echo "Completed";}
	?></td>
    <td>
    <a href="<?= site_url('user/tasks/milestones').'/'.$project->id;?>"> Milestone</a> 
    
    
    </td>
  </tr>
  <?php }?>  
</table>

